package com.itheima.utilstudent;

import java.util.ArrayList;

public class UtilStudent {
    private UtilStudent(){

    };

   public static int getMaxAge(ArrayList<Student> list){
       int max = list.get(0).getAge();
       for (int i = 1; i < list.size(); i++) {
           Student s = list.get(i);
           if (s.getAge()>max){
               max = s.getAge();
           }
       }
       return max;
   }
}
